import requestProxy from '@/utils/request';

const { request } = requestProxy;

export function getUpOnlineTab(params) {
  return request({
    url: '/admin/upOnline/tab',
    method: 'get',
    params
  });
}

export function getUpOnlineList(params) {
  return request({
    url: '/admin/upOnline/list',
    method: 'get',
    params
  });
}

export function getUpOnlineAccountList(params) {
  return request({
    url: '/admin/upOnline/account/list',
    method: 'get',
    params
  });
}

export function getUpOnlineAccount(params) {
  return request({
    url: '/admin/upOnline/account',
    method: 'get',
    params
  });
}

export function submitUpOnlineForm(data) {
  return request({
    url: '/admin/upOnline/formSubmit',
    method: 'post',
    data
  });
}

export function createUpOnline(data) {
  return request({
    url: '/admin/upOnline/create',
    method: 'post',
    data
  });
}

export function editUpOnline(data) {
  return request({
    url: '/admin/upOnline/edit',
    method: 'put',
    data
  });
}

export function delUpOnline(id) {
  return request({
    url: `/admin/upOnline/delete/${id}`,
    method: 'delete'
  });
}

// 评论列表
export function getUpOnlineComments(params) {
  return request({
    url: '/admin/upOnline/comments/list',
    method: 'get',
    params
  });
}

// 发表评论
export function upOnlineCommentAdd(data) {
  return request({
    url: '/admin/upOnline/comments/add',
    method: 'post',
    data
  });
}

// 表单提交、获取审批流
export function formSubmit(data) {
  return request({
    url: `/admin/upOnline/formSubmit`,
    method: 'post',
    data
  });
}

// 流程审批
export function upOnlineProcessAudit(data) {
  return request({
    url: '/admin/upOnline/process/audit',
    method: 'post',
    data
  });
}

// 流程作废
export function upOnlineRevocation(data) {
  return request({
    url: '/admin/upOnline/process/revocation',
    method: 'post',
    data
  });
}

// 上刊详情
export function upOnlineDetail(id) {
  return request({
    url: `/admin/upOnline/detail/${id}`,
    method: 'get'
  });
}

// 撤回
export function upOnlineProcessRecall(data) {
  return request({
    url: '/admin/upOnline/process/recall',
    method: 'post',
    data
  });
}
